package com.sjh.test.java8.lambda;

import java.util.Arrays;
import java.util.List;

public class LambdaTest4 {

    public static void main(String[] args)
    {
        LambdaTest4 tester = new LambdaTest4();
        tester.run();
    }

    public void run()
    {
        List<String> list = Arrays.asList("Action","Cebci","Back");

        // 输出
        list.forEach(System.out::println);

        // 转换为大写
        list.forEach(LambdaTest4::upperAndPrint);

        // 转换为小写并输出
        list.forEach(this::lowerAndPrint);
    }

    public void lowerAndPrint(String s)
    {
        System.out.println(s.toLowerCase());
    }

    public static void upperAndPrint(String s)
    {
        System.out.println(s.toUpperCase());
    }

}
